package com.bilibili.service.impl;

import java.util.List;

import com.bilibili.dao.SelectVideoDao;
import com.bilibili.dao.VideoDao;
import com.bilibili.dao.impl.SelectVideoDaoImpl;
import com.bilibili.dao.impl.VideoDaoImpl;
import com.bilibili.dto.VideoAndUser;
import com.bilibili.entity.Video;
import com.bilibili.service.SelectVideoService;

public class SelectVideoServiceImpl implements SelectVideoService {
	private SelectVideoDao selectVideosDao=new SelectVideoDaoImpl();
	VideoDao v = new VideoDaoImpl();
	@Override
	public List<VideoAndUser> getAllVideos() {
		return selectVideosDao.selectAllVideos();
	}
	@Override
	public VideoAndUser getVideoByVideoId(int videoId) {
		// TODO Auto-generated method stub
		v.addVideoviewCount(videoId);
		return selectVideosDao.selectVideoByVideoId(videoId);
	}
	@Override
	public Video selectCount(int videoId) {
		// TODO Auto-generated method stub
		return selectVideosDao.selectCount(videoId);
	}
	@Override
	public boolean updateAllCount(Video video) {
		// TODO Auto-generated method stub
		return selectVideosDao.updateAllCount(video)==1;
	}

}
